<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	  <%@include file="/res/include/base-head.jsp"%>
	  <%@include file="/res/include/jquery-easyui.jsp"%>
	<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/hi/hiRule.js"></script>
  </head>
  <body>
	<div class="easyui-layout" data-options="fit:true">
		   <div data-options="region:'north',border:false,split:false">
			   <form id="query-form" class="search_form clearfix">
			            <p class="search_form_btn">
			            	<input type="button" value="添加" class="icon_serach" onclick="admin.hiRule.toAdd()" />
			            </p>
			   </form>
		   </div>
		   <div data-options="region:'center',border:false">
			    <table id="datagrid" data-options="url:'${pageContext.request.contextPath}/hi/rule/list',toolbar:'#toolbar'">
					<thead>
						<tr>
							<th data-options="field:'strClassify',width:150,align:'center' ">分类</th>
							<th data-options="field:'name',width:200,align:'center' ">规则名称</th>
							<th data-options="field:'desc',width:400,align:'center' ">规则描述</th>
							<th data-options="field:'quanValue',width:80,align:'center' ">奖励圈币值</th>
							<th data-options="field:'honorValue',width:80,align:'center' ">奖励荣誉值</th>
							<th data-options="field:'limitDayTimes',width:80,align:'center'">每日上限次数</th>
							<th data-options="field:'limitQuantity',width:80,align:'center' ">上限数量</th>
							<th data-options="field:'status',width:80,align:'center',formatter:formatStatus">是否有效</th>
							<th data-options="field:'taskType',width:80,align:'center',formatter:formatTaskType">类型</th>
				            <th data-options="field:'id',align:'center',width:200,formatter:formatOperation">管理操作</th>
						</tr>
					</thead>
				</table>
	  	  </div>
	</div>
	<script>
		 function formatOperation(value,row,index) {
			 var l_html = '';
			 l_html += '<a href="javascript:;" class="table_link" onclick="admin.hiRule.update('+row.id+')">编辑</a>';
			return l_html;
		}
		function formatCompare(compare) {
			var l_html = '';//条件:1-大于;2-等于;3-小于
			if(compare==1){
				l_html="大于";
			} else if(compare==2){
				l_html="等于";
			} else if(compare==3){
				l_html="小于";
			}
			return l_html;
		}
		function formatStatus(status) {
			var l_html = '';//是否有效:1-正常;2-失效'
			if(status==1){
				l_html="正常";
			} else if(status==2){
				l_html="失效";
			}
			return l_html;
		}
		
		function formatTaskType(taskType) {
			var l_html = '';//HiRuleTaskTypeDictEnum类型:1-新手任务;2-连续任务
			if(taskType==1){
				l_html="新手任务";
			} else if(taskType==2){
				l_html="连续任务";
			}
			return l_html;
		}
		
		function formatCalculationType(calculationType) {
			var l_html = '';//HiRuleCalculationTypeDictEnum计算类型:1-按整数计算;2-按比例计算
			if(calculationType==1){
				l_html="按整数计算";
			} else if(calculationType==2){
				l_html="按比例计算";
			}
			return l_html;
		}
	</script>
  </body>
</html>
